import { ApiProperty } from '@nestjs/swagger';

export class BasicVo<T> {
  @ApiProperty({
    type: String,
    description: '响应码',
    example: 0,
  })
  code: number;

  @ApiProperty({
    type: String,
    description: '提示信息',
    example: '成功',
  })
  mgs: string;

  @ApiProperty({ type: Object, description: '数据' })
  data?: T;

  @ApiProperty({
    type: String,
    description: '链路ID',
    example: '420bb347-6a46-4188-bde8-613dafdb7672',
  })
  traceId?: string;

  @ApiProperty({
    type: String,
    description: '请求的时间',
    example: '2024-03-06T09:03:21.044Z',
  })
  timestamp?: string;

  @ApiProperty({
    type: String,
    description: '请求的路径',
    example: '/api/user/v1',
  })
  path?: string;

  @ApiProperty({
    type: String,
    description: '请求的方法',
    example: 'GET',
  })
  method?: string;
}
